//
//  CCNetTool.h
//  HimalayaMountain
//
//  Created by dllo on 16/7/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>



typedef void(^successBlock) (id result);   // 如果要用task 就在(id result)这个位置加task
typedef void(^failuredBlock) (NSError *error);


typedef NS_ENUM(NSUInteger, CCResponseStyle) {
    CCJSON,
    CCDATA,
    CCXML,
};

typedef NS_ENUM(NSUInteger, CCRequestStyle) {
    CCBodyString,
    CCBodyJSON,
};



@interface CCNetTool : NSObject



+(void)GET:(NSString *)url body:(id)body headerFile:(NSDictionary *)headers response:(CCResponseStyle)responseStyle success:(successBlock)success failure:(failuredBlock)failure;

+(void)POST:(NSString *)url body:(id)body bodyStyle:(CCRequestStyle)bodyStyle headerFile:(NSDictionary *)headers response:(CCResponseStyle)responseStyle success:(successBlock)success failure:(failuredBlock)failure;


@end
